<?php

namespace app\admin\model;

use app\common\constants\MenuConstant;
use app\common\model\TimeModel;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;

class InsuranceImport extends TimeModel
{
    protected function getOptions(): array
    {
        return [
            'deleteTime' => 'delete_time',
        ];
    }

    public function setStartAtAttr($value){
        return empty($value) ? $value : strtotime($value);
    }

    public function getStartAtAttr($value){
        return empty($value) ? $value : date('Y-m-d H:i:s', $value);
    }

    public function setEndAtAttr($value){
        return empty($value) ? $value : strtotime($value);
    }

    public function getEndAtAttr($value){
        return empty($value) ? $value : date('Y-m-d H:i:s', $value);
    }

    public function setCreateAtAttr($value){
        if (empty($value)) return $value;
        if (is_numeric($value)) return $value;
        return strtotime($value);
    }

    public function getCreateAtAttr($value){
        return empty($value) ? $value : date('Y-m-d', $value);
    }
}